#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Maxn=3e6+7;
char S[Maxn];
int n;

int main(){
	freopen("song.in","r",stdin);
	freopen("song.out","w",stdout);
    scanf("%s",S+1);
    n=strlen(S+1);

    if(S[1]=='A'){
        printf("%d",(n+1)/2);
    }
    else{
        printf("%d",(n+1)/2+(n%2==0));
    }

    return 0;
}
